package com.dmxtechnologies.community.pojo;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.dmxtechnologies.community.rar.api.CMSBaseResponse;

public class CMSDetailResponse extends CMSBaseResponse {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6992629983388642698L;
	private String titleId;
	private String categoryId;
	private String movieId;
	private String asset_id;
	private String type;
	private int sortNum;
	private String createTime; 
	private String content;
	private int pageNum;
	
	public CMSDetailResponse(String json,String smallPicURL) {
		List<DateList> list = new ArrayList<>();
		DateList dateList = new DateList(); 
		if(json != null){
//			StringReader reader = new StringReader(json.replaceAll("\r\n",""));
//			JsonObject jsonObject=Json.createReader(reader).readObject(); 
			JSONObject jsonObject = JSONObject.parseObject(json.replaceAll("\r\n",""));
			this.totalPage = jsonObject.getInteger("totalPage");
			this.titleId = jsonObject.getString("titleId");
			this.categoryId = jsonObject.getString("categoryId");
			this.movieId = jsonObject.getString("movieId");
			this.asset_id = jsonObject.getString("asset_id");
			this.type = jsonObject.getString("type");
			this.sortNum = jsonObject.getInteger("sortNum");
			this.createTime = jsonObject.getString("createTime");
			this.content = jsonObject.getString("content");
			this.pageNum = jsonObject.getInteger("pageNum");
			dateList.setTitle(jsonObject.getString("title"));
			dateList.setSmallpic(jsonObject.getString("smallPic"));
			dateList.setBigpic(jsonObject.getString("bigPic"));
			list.add(dateList);
			this.dataList = list;
			this.smallPicURL = smallPicURL;
		}
	}

	public String getTitleId() {
		return titleId;
	}

	public void setTitleId(String titleId) {
		this.titleId = titleId;
	}

	public String getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(String categoryId) {
		this.categoryId = categoryId;
	}

	public String getMovieId() {
		return movieId;
	}

	public void setMovieId(String movieId) {
		this.movieId = movieId;
	}

	public String getAsset_id() {
		return asset_id;
	}

	public void setAsset_id(String asset_id) {
		this.asset_id = asset_id;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Integer getSortNum() {
		return sortNum;
	}

	public void setSortNum(Integer sortNum) {
		this.sortNum = sortNum;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Integer getPageNum() {
		return pageNum;
	}

	public void setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
	}
	
}
